/*
 * Dao v0.1
 * @author @bonex2 
 */
package main;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class Dao {

	Connection conn = null;

	public Connection getConn() {
		return conn;
	}

	public void setConn(Connection conn) {
		this.conn = conn;
	}

	public Dao() throws Exception {
		// 载入并获取conn,mdb還是算了...
		Class.forName("com.mysql.jdbc.Driver");
		String url = "jdbc:mysql://localhost/test?" // 你的數據庫名
				+ "user=root&password=";            // 用戶名，密碼
		conn = DriverManager.getConnection(url);
	}

	static public void main(String[] args) throws Exception {
		Connection conn = new Dao().getConn();
		Statement stmt = conn.createStatement();
		stmt.execute("INSERT INTO LOGS SET LOGS = '鎮鬱悶'");
	}
}
